package com.ruoyi.prodata.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.workorder.service.IWorkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 项目问题统
 * @author zhangzhihao
 */
@RestController
@RequestMapping("/prodata/problemStatistics")
public class ProblemStatisticsController extends BaseController {
    @Autowired
    private IWorkOrderService workOrderService;

    /**
     * 查询项目问题统计数据
     *
     * @param projectId 项目id
     * @return 结果
     */
    @PreAuthorize("@ss.hasPermi('prodata:statistics:list')")
    @GetMapping("/list")
    public AjaxResult list(Long projectId) {
        List<Map<String,Object>> list = workOrderService.selectProblemStatistics(projectId);
        return success(list);
    }
}
